package cn.net.xyan.easy.spring.web.support;

import org.springframework.web.servlet.view.freemarker.FreeMarkerView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * Created by xiashenpin on 16/2/11.
 */
public class EZFreeMarkerView extends FreeMarkerView {
    @Override
    protected void doRender(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
        String contentType = (String) model.get("ContentType");
        if (contentType!= null && contentType.length()>0)
            setContentType(contentType);
        super.doRender(model, request, response);
    }
}
